<!doctype html>
<meta charset="utf-8">
<title>Paint Timing API</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var t = async_test("Performance entries observer");
var observer = new PerformanceObserver(t.step_func_done(list => {
  list.getEntries().forEach((entry, i) => {
    var name = i == 0 ? "first-paint" : "first-contentful-paint";
    assert_equals(entry.name, name, "Name is " + name);
    assert_equals(entry.entryType, "paint", "Entry type is paint");
    assert_true(entry.startTime > 0, "Start time is > 0");
    assert_equals(entry.duration, 0, "Duration is 0");
  });
}));
observer.observe({entryTypes: ['paint'], buffered: true});
</script>
